package com.ls.common.enums;

/**
 * @Author lisheng
 * @Date 2025/05/07 09:05
 **/
public enum TaskTypeEnum {

    START_EVENT("startEvent","开始"),
    USER_TASK("userTask","人工任务"),
    MULTI_INSTANCE_BODY("multiInstanceBody","多实例任务"),
    SUB_PROCESS("subProcess","子流程"),
    SERVICE_TASK("serviceTask","服务任务"),
    SCRIPT_TASK("scriptTask", "脚本任务"),
    RECEIVE_TASK("receiveTask","接收任务"),
    NONE_END_EVENT("noneEndEvent","办结");

    private String code;
    private String name;

    TaskTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static TaskTypeEnum fromCode(String code) {
        for (TaskTypeEnum e: TaskTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String state) {
        this.name = name;
    }
}

